﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using UnityEngine;
using UnityEngine.Events;

namespace Valve.VR.InteractionSystem
{
	// Token: 0x02000608 RID: 1544
	public class Hand : MonoBehaviour
	{
		// Token: 0x170004C4 RID: 1220
		// (get) Token: 0x06002731 RID: 10033 RVA: 0x000E4B28 File Offset: 0x000E2D28
		public ReadOnlyCollection<Hand.AttachedObject> AttachedObjects
		{
			get
			{
				return this.attachedObjects.AsReadOnly();
			}
		}

		// Token: 0x170004C5 RID: 1221
		// (get) Token: 0x06002732 RID: 10034 RVA: 0x000E4B38 File Offset: 0x000E2D38
		// (set) Token: 0x06002733 RID: 10035 RVA: 0x000E4B40 File Offset: 0x000E2D40
		public bool hoverLocked { get; private set; }

		// Token: 0x170004C6 RID: 1222
		// (get) Token: 0x06002734 RID: 10036 RVA: 0x000E4B4C File Offset: 0x000E2D4C
		// (set) Token: 0x06002735 RID: 10037 RVA: 0x000E4B54 File Offset: 0x000E2D54
		public Interactable hoveringInteractable
		{
			get
			{
				return this._hoveringInteractable;
			}
			set
			{
				if (this._hoveringInteractable != value)
				{
					if (this._hoveringInteractable != null)
					{
						this.HandDebugLog("HoverEnd " + this._hoveringInteractable.gameObject);
						this._hoveringInteractable.SendMessage("OnHandHoverEnd", this, SendMessageOptions.DontRequireReceiver);
						if (this._hoveringInteractable != null)
						{
							base.BroadcastMessage("OnParentHandHoverEnd", this._hoveringInteractable, SendMessageOptions.DontRequireReceiver);
						}
					}
					this._hoveringInteractable = value;
					if (this._hoveringInteractable != null)
					{
						this.HandDebugLog("HoverBegin " + this._hoveringInteractable.gameObject);
						this._hoveringInteractable.SendMessage("OnHandHoverBegin", this, SendMessageOptions.DontRequireReceiver);
						if (this._hoveringInteractable != null)
						{
							base.BroadcastMessage("OnParentHandHoverBegin", this._hoveringInteractable, SendMessageOptions.DontRequireReceiver);
						}
					}
				}
			}
		}

		// Token: 0x170004C7 RID: 1223
		// (get) Token: 0x06002736 RID: 10038 RVA: 0x000E4C3C File Offset: 0x000E2E3C
		public GameObject currentAttachedObject
		{
			get
			{
				this.CleanUpAttachedObjectStack();
				if (this.attachedObjects.Count > 0)
				{
					return this.attachedObjects[this.attachedObjects.Count - 1].attachedObject;
				}
				return null;
			}
		}

		// Token: 0x06002737 RID: 10039 RVA: 0x000E4C84 File Offset: 0x000E2E84
		public Transform GetAttachmentTransform(string attachmentPoint = "")
		{
			Transform transform = null;
			if (!string.IsNullOrEmpty(attachmentPoint))
			{
				transform = base.transform.Find(attachmentPoint);
			}
			if (!transform)
			{
				transform = base.transform;
			}
			return transform;
		}

		// Token: 0x06002738 RID: 10040 RVA: 0x000E4CC0 File Offset: 0x000E2EC0
		public Hand.HandType GuessCurrentHandType()
		{
			if (this.startingHandType == Hand.HandType.Left || this.startingHandType == Hand.HandType.Right)
			{
				return this.startingHandType;
			}
			if (this.startingHandType == Hand.HandType.Any && this.otherHand != null && this.otherHand.controller == null)
			{
				return Hand.HandType.Right;
			}
			if (this.controller == null || this.otherHand == null || this.otherHand.controller == null)
			{
				return this.startingHandType;
			}
			if ((ulong)this.controller.index == (ulong)((long)SteamVR_Controller.GetDeviceIndex(SteamVR_Controller.DeviceRelation.Leftmost, ETrackedDeviceClass.Controller, 0)))
			{
				return Hand.HandType.Left;
			}
			return Hand.HandType.Right;
		}

		// Token: 0x06002739 RID: 10041 RVA: 0x000E4D6C File Offset: 0x000E2F6C
		public void AttachObject(GameObject objectToAttach, Hand.AttachmentFlags flags = Hand.AttachmentFlags.SnapOnAttach | Hand.AttachmentFlags.DetachOthers | Hand.AttachmentFlags.DetachFromOtherHand | Hand.AttachmentFlags.ParentToHand, string attachmentPoint = "")
		{
			if (flags == (Hand.AttachmentFlags)0)
			{
				flags = (Hand.AttachmentFlags.SnapOnAttach | Hand.AttachmentFlags.DetachOthers | Hand.AttachmentFlags.DetachFromOtherHand | Hand.AttachmentFlags.ParentToHand);
			}
			this.CleanUpAttachedObjectStack();
			this.DetachObject(objectToAttach, true);
			if ((flags & Hand.AttachmentFlags.DetachFromOtherHand) == Hand.AttachmentFlags.DetachFromOtherHand && this.otherHand)
			{
				this.otherHand.DetachObject(objectToAttach, true);
			}
			if ((flags & Hand.AttachmentFlags.DetachOthers) == Hand.AttachmentFlags.DetachOthers)
			{
				while (this.attachedObjects.Count > 0)
				{
					this.DetachObject(this.attachedObjects[0].attachedObject, true);
				}
			}
			if (this.currentAttachedObject)
			{
				this.currentAttachedObject.SendMessage("OnHandFocusLost", this, SendMessageOptions.DontRequireReceiver);
			}
			Hand.AttachedObject item = default(Hand.AttachedObject);
			item.attachedObject = objectToAttach;
			item.originalParent = ((!(objectToAttach.transform.parent != null)) ? null : objectToAttach.transform.parent.gameObject);
			if ((flags & Hand.AttachmentFlags.ParentToHand) == Hand.AttachmentFlags.ParentToHand)
			{
				objectToAttach.transform.parent = this.GetAttachmentTransform(attachmentPoint);
				item.isParentedToHand = true;
			}
			else
			{
				item.isParentedToHand = false;
			}
			this.attachedObjects.Add(item);
			if ((flags & Hand.AttachmentFlags.SnapOnAttach) == Hand.AttachmentFlags.SnapOnAttach)
			{
				objectToAttach.transform.localPosition = Vector3.zero;
				objectToAttach.transform.localRotation = Quaternion.identity;
			}
			this.HandDebugLog("AttachObject " + objectToAttach);
			objectToAttach.SendMessage("OnAttachedToHand", this, SendMessageOptions.DontRequireReceiver);
			this.UpdateHovering();
		}

		// Token: 0x0600273A RID: 10042 RVA: 0x000E4EE0 File Offset: 0x000E30E0
		public void DetachObject(GameObject objectToDetach, bool restoreOriginalParent = true)
		{
			int num = this.attachedObjects.FindIndex((Hand.AttachedObject l) => l.attachedObject == objectToDetach);
			if (num != -1)
			{
				this.HandDebugLog("DetachObject " + objectToDetach);
				GameObject currentAttachedObject = this.currentAttachedObject;
				Transform parent = null;
				if (this.attachedObjects[num].isParentedToHand)
				{
					if (restoreOriginalParent && this.attachedObjects[num].originalParent != null)
					{
						parent = this.attachedObjects[num].originalParent.transform;
					}
					this.attachedObjects[num].attachedObject.transform.parent = parent;
				}
				this.attachedObjects[num].attachedObject.SetActive(true);
				this.attachedObjects[num].attachedObject.SendMessage("OnDetachedFromHand", this, SendMessageOptions.DontRequireReceiver);
				this.attachedObjects.RemoveAt(num);
				GameObject currentAttachedObject2 = this.currentAttachedObject;
				if (currentAttachedObject2 != null && currentAttachedObject2 != currentAttachedObject)
				{
					currentAttachedObject2.SetActive(true);
					currentAttachedObject2.SendMessage("OnHandFocusAcquired", this, SendMessageOptions.DontRequireReceiver);
				}
			}
			this.CleanUpAttachedObjectStack();
		}

		// Token: 0x0600273B RID: 10043 RVA: 0x000E503C File Offset: 0x000E323C
		public Vector3 GetTrackedObjectVelocity()
		{
			if (this.controller != null)
			{
				return base.transform.parent.TransformVector(this.controller.velocity);
			}
			return Vector3.zero;
		}

		// Token: 0x0600273C RID: 10044 RVA: 0x000E506C File Offset: 0x000E326C
		public Vector3 GetTrackedObjectAngularVelocity()
		{
			if (this.controller != null)
			{
				return base.transform.parent.TransformVector(this.controller.angularVelocity);
			}
			return Vector3.zero;
		}

		// Token: 0x0600273D RID: 10045 RVA: 0x000E509C File Offset: 0x000E329C
		private void CleanUpAttachedObjectStack()
		{
			this.attachedObjects.RemoveAll((Hand.AttachedObject l) => l.attachedObject == null);
		}

		// Token: 0x0600273E RID: 10046 RVA: 0x000E50C8 File Offset: 0x000E32C8
		private void Awake()
		{
			this.inputFocusAction = SteamVR_Events.InputFocusAction(new UnityAction<bool>(this.OnInputFocus));
			if (this.hoverSphereTransform == null)
			{
				this.hoverSphereTransform = base.transform;
			}
			this.applicationLostFocusObject = new GameObject("_application_lost_focus");
			this.applicationLostFocusObject.transform.parent = base.transform;
			this.applicationLostFocusObject.SetActive(false);
		}

		// Token: 0x0600273F RID: 10047 RVA: 0x000E513C File Offset: 0x000E333C
		private IEnumerator Start()
		{
			this.playerInstance = Player.instance;
			if (!this.playerInstance)
			{
				GlobalData.Debug_LogError("No player instance found in Hand Start()");
			}
			this.overlappingColliders = new Collider[16];
			if (this.noSteamVRFallbackCamera)
			{
				yield break;
			}
			for (;;)
			{
				yield return new WaitForSeconds(1f);
				if (this.controller != null)
				{
					break;
				}
				if (this.startingHandType == Hand.HandType.Left || this.startingHandType == Hand.HandType.Right)
				{
					int deviceIndex = SteamVR_Controller.GetDeviceIndex(SteamVR_Controller.DeviceRelation.Leftmost, ETrackedDeviceClass.Controller, 0);
					int deviceIndex2 = SteamVR_Controller.GetDeviceIndex(SteamVR_Controller.DeviceRelation.Rightmost, ETrackedDeviceClass.Controller, 0);
					if (deviceIndex != -1 && deviceIndex2 != -1 && deviceIndex != deviceIndex2)
					{
						int index = (this.startingHandType != Hand.HandType.Right) ? deviceIndex : deviceIndex2;
						int index2 = (this.startingHandType != Hand.HandType.Right) ? deviceIndex2 : deviceIndex;
						this.InitController(index);
						if (this.otherHand)
						{
							this.otherHand.InitController(index2);
						}
					}
				}
				else
				{
					SteamVR instance = SteamVR.instance;
					int num = 0;
					while ((long)num < 16L)
					{
						if (instance.hmd.GetTrackedDeviceClass((uint)num) == ETrackedDeviceClass.Controller)
						{
							SteamVR_Controller.Device device = SteamVR_Controller.Input(num);
							if (device.valid)
							{
								if (!(this.otherHand != null) || this.otherHand.controller == null || num != (int)this.otherHand.controller.index)
								{
									this.InitController(num);
								}
							}
						}
						num++;
					}
				}
			}
			yield break;
		}

		// Token: 0x06002740 RID: 10048 RVA: 0x000E5158 File Offset: 0x000E3358
		private void UpdateHovering()
		{
			if (this.noSteamVRFallbackCamera == null && this.controller == null)
			{
				return;
			}
			if (this.hoverLocked)
			{
				return;
			}
			if (this.applicationLostFocusObject.activeSelf)
			{
				return;
			}
			float num = float.MaxValue;
			Interactable hoveringInteractable = null;
			float x = this.playerInstance.transform.lossyScale.x;
			float num2 = this.hoverSphereRadius * x;
			float num3 = Mathf.Abs(base.transform.position.y - this.playerInstance.trackingOriginTransform.position.y);
			float num4 = Util.RemapNumberClamped(num3, 0f, 0.5f * x, 5f, 1f) * x;
			for (int i = 0; i < this.overlappingColliders.Length; i++)
			{
				this.overlappingColliders[i] = null;
			}
			Physics.OverlapBoxNonAlloc(this.hoverSphereTransform.position - new Vector3(0f, num2 * num4 - num2, 0f), new Vector3(num2, num2 * num4 * 2f, num2), this.overlappingColliders, Quaternion.identity, this.hoverLayerMask.value);
			int num5 = 0;
			Collider[] array = this.overlappingColliders;
			for (int j = 0; j < array.Length; j++)
			{
				Collider collider = array[j];
				if (!(collider == null))
				{
					Interactable contacting = collider.GetComponentInParent<Interactable>();
					if (!(contacting == null))
					{
						IgnoreHovering component = collider.GetComponent<IgnoreHovering>();
						if (!(component != null) || (!(component.onlyIgnoreHand == null) && !(component.onlyIgnoreHand == this)))
						{
							if (this.attachedObjects.FindIndex((Hand.AttachedObject l) => l.attachedObject == contacting.gameObject) == -1)
							{
								if (!this.otherHand || !(this.otherHand.hoveringInteractable == contacting))
								{
									float num6 = Vector3.Distance(contacting.transform.position, this.hoverSphereTransform.position);
									if (num6 < num)
									{
										num = num6;
										hoveringInteractable = contacting;
									}
									num5++;
								}
							}
						}
					}
				}
			}
			this.hoveringInteractable = hoveringInteractable;
			if (num5 > 0 && num5 != this.prevOverlappingColliders)
			{
				this.prevOverlappingColliders = num5;
				this.HandDebugLog("Found " + num5 + " overlapping colliders.");
			}
		}

		// Token: 0x06002741 RID: 10049 RVA: 0x000E5418 File Offset: 0x000E3618
		private void UpdateNoSteamVRFallback()
		{
			if (this.noSteamVRFallbackCamera)
			{
				Ray ray = this.noSteamVRFallbackCamera.ScreenPointToRay(Input.mousePosition);
				if (this.attachedObjects.Count > 0)
				{
					base.transform.position = ray.origin + this.noSteamVRFallbackInteractorDistance * ray.direction;
				}
				else
				{
					Vector3 position = base.transform.position;
					base.transform.position = this.noSteamVRFallbackCamera.transform.forward * -1000f;
					RaycastHit raycastHit;
					if (Physics.Raycast(ray, out raycastHit, this.noSteamVRFallbackMaxDistanceNoItem))
					{
						base.transform.position = raycastHit.point;
						this.noSteamVRFallbackInteractorDistance = Mathf.Min(this.noSteamVRFallbackMaxDistanceNoItem, raycastHit.distance);
					}
					else if (this.noSteamVRFallbackInteractorDistance > 0f)
					{
						base.transform.position = ray.origin + Mathf.Min(this.noSteamVRFallbackMaxDistanceNoItem, this.noSteamVRFallbackInteractorDistance) * ray.direction;
					}
					else
					{
						base.transform.position = position;
					}
				}
			}
		}

		// Token: 0x06002742 RID: 10050 RVA: 0x000E5550 File Offset: 0x000E3750
		private void UpdateDebugText()
		{
			if (this.showDebugText)
			{
				if (this.debugText == null)
				{
					this.debugText = new GameObject("_debug_text").AddComponent<TextMesh>();
					this.debugText.fontSize = 120;
					this.debugText.characterSize = 0.001f;
					this.debugText.transform.parent = base.transform;
					this.debugText.transform.localRotation = Quaternion.Euler(90f, 0f, 0f);
				}
				if (this.GuessCurrentHandType() == Hand.HandType.Right)
				{
					this.debugText.transform.localPosition = new Vector3(-0.05f, 0f, 0f);
					this.debugText.alignment = TextAlignment.Right;
					this.debugText.anchor = TextAnchor.UpperRight;
				}
				else
				{
					this.debugText.transform.localPosition = new Vector3(0.05f, 0f, 0f);
					this.debugText.alignment = TextAlignment.Left;
					this.debugText.anchor = TextAnchor.UpperLeft;
				}
				this.debugText.text = string.Format("Hovering: {0}\nHover Lock: {1}\nAttached: {2}\nTotal Attached: {3}\nType: {4}\n", new object[]
				{
					(!this.hoveringInteractable) ? "null" : this.hoveringInteractable.gameObject.name,
					this.hoverLocked,
					(!this.currentAttachedObject) ? "null" : this.currentAttachedObject.name,
					this.attachedObjects.Count,
					this.GuessCurrentHandType().ToString()
				});
			}
			else if (this.debugText != null)
			{
				UnityEngine.Object.Destroy(this.debugText.gameObject);
			}
		}

		// Token: 0x06002743 RID: 10051 RVA: 0x000E573C File Offset: 0x000E393C
		private void OnEnable()
		{
			this.inputFocusAction.enabled = true;
			float time = (!(this.otherHand != null) || this.otherHand.GetInstanceID() >= base.GetInstanceID()) ? 0f : (0.5f * this.hoverUpdateInterval);
			base.InvokeRepeating("UpdateHovering", time, this.hoverUpdateInterval);
			base.InvokeRepeating("UpdateDebugText", time, this.hoverUpdateInterval);
		}

		// Token: 0x06002744 RID: 10052 RVA: 0x000E57B8 File Offset: 0x000E39B8
		private void OnDisable()
		{
			this.inputFocusAction.enabled = false;
			base.CancelInvoke();
		}

		// Token: 0x06002745 RID: 10053 RVA: 0x000E57CC File Offset: 0x000E39CC
		private void Update()
		{
			this.UpdateNoSteamVRFallback();
			GameObject currentAttachedObject = this.currentAttachedObject;
			if (currentAttachedObject)
			{
				currentAttachedObject.SendMessage("HandAttachedUpdate", this, SendMessageOptions.DontRequireReceiver);
			}
			if (this.hoveringInteractable)
			{
				this.hoveringInteractable.SendMessage("HandHoverUpdate", this, SendMessageOptions.DontRequireReceiver);
			}
		}

		// Token: 0x06002746 RID: 10054 RVA: 0x000E5820 File Offset: 0x000E3A20
		private void LateUpdate()
		{
			if (this.controllerObject != null && this.attachedObjects.Count == 0)
			{
				this.AttachObject(this.controllerObject, Hand.AttachmentFlags.SnapOnAttach | Hand.AttachmentFlags.DetachOthers | Hand.AttachmentFlags.DetachFromOtherHand | Hand.AttachmentFlags.ParentToHand, string.Empty);
			}
		}

		// Token: 0x06002747 RID: 10055 RVA: 0x000E5858 File Offset: 0x000E3A58
		private void OnInputFocus(bool hasFocus)
		{
			if (hasFocus)
			{
				this.DetachObject(this.applicationLostFocusObject, true);
				this.applicationLostFocusObject.SetActive(false);
				this.UpdateHandPoses();
				this.UpdateHovering();
				base.BroadcastMessage("OnParentHandInputFocusAcquired", SendMessageOptions.DontRequireReceiver);
			}
			else
			{
				this.applicationLostFocusObject.SetActive(true);
				this.AttachObject(this.applicationLostFocusObject, Hand.AttachmentFlags.ParentToHand, string.Empty);
				base.BroadcastMessage("OnParentHandInputFocusLost", SendMessageOptions.DontRequireReceiver);
			}
		}

		// Token: 0x06002748 RID: 10056 RVA: 0x000E58CC File Offset: 0x000E3ACC
		private void FixedUpdate()
		{
			this.UpdateHandPoses();
		}

		// Token: 0x06002749 RID: 10057 RVA: 0x000E58D4 File Offset: 0x000E3AD4
		private void OnDrawGizmos()
		{
			Gizmos.color = new Color(0.5f, 1f, 0.5f, 0.9f);
			Transform transform = (!this.hoverSphereTransform) ? base.transform : this.hoverSphereTransform;
			Gizmos.DrawWireSphere(transform.position, this.hoverSphereRadius);
		}

		// Token: 0x0600274A RID: 10058 RVA: 0x000E5934 File Offset: 0x000E3B34
		private void HandDebugLog(string msg)
		{
			if (this.spewDebugText)
			{
				GlobalData.Debug_Log("Hand (" + base.name + "): " + msg);
			}
		}

		// Token: 0x0600274B RID: 10059 RVA: 0x000E595C File Offset: 0x000E3B5C
		private void UpdateHandPoses()
		{
			if (this.controller != null)
			{
				SteamVR instance = SteamVR.instance;
				if (instance != null)
				{
					TrackedDevicePose_t trackedDevicePose_t = default(TrackedDevicePose_t);
					TrackedDevicePose_t trackedDevicePose_t2 = default(TrackedDevicePose_t);
					if (instance.compositor.GetLastPoseForTrackedDeviceIndex(this.controller.index, ref trackedDevicePose_t, ref trackedDevicePose_t2) == EVRCompositorError.None)
					{
						SteamVR_Utils.RigidTransform rigidTransform = new SteamVR_Utils.RigidTransform(trackedDevicePose_t2.mDeviceToAbsoluteTracking);
						base.transform.localPosition = rigidTransform.pos;
						base.transform.localRotation = rigidTransform.rot;
					}
				}
			}
		}

		// Token: 0x0600274C RID: 10060 RVA: 0x000E59E4 File Offset: 0x000E3BE4
		public void HoverLock(Interactable interactable)
		{
			this.HandDebugLog("HoverLock " + interactable);
			this.hoverLocked = true;
			this.hoveringInteractable = interactable;
		}

		// Token: 0x0600274D RID: 10061 RVA: 0x000E5A08 File Offset: 0x000E3C08
		public void HoverUnlock(Interactable interactable)
		{
			this.HandDebugLog("HoverUnlock " + interactable);
			if (this.hoveringInteractable == interactable)
			{
				this.hoverLocked = false;
			}
		}

		// Token: 0x0600274E RID: 10062 RVA: 0x000E5A34 File Offset: 0x000E3C34
		public bool GetStandardInteractionButtonDown()
		{
			if (this.noSteamVRFallbackCamera)
			{
				return Input.GetMouseButtonDown(0);
			}
			return this.controller != null && this.controller.GetHairTriggerDown();
		}

		// Token: 0x0600274F RID: 10063 RVA: 0x000E5A68 File Offset: 0x000E3C68
		public bool GetStandardInteractionButtonUp()
		{
			if (this.noSteamVRFallbackCamera)
			{
				return Input.GetMouseButtonUp(0);
			}
			return this.controller != null && this.controller.GetHairTriggerUp();
		}

		// Token: 0x06002750 RID: 10064 RVA: 0x000E5A9C File Offset: 0x000E3C9C
		public bool GetStandardInteractionButton()
		{
			if (this.noSteamVRFallbackCamera)
			{
				return Input.GetMouseButton(0);
			}
			return this.controller != null && this.controller.GetHairTrigger();
		}

		// Token: 0x06002751 RID: 10065 RVA: 0x000E5AD0 File Offset: 0x000E3CD0
		private void InitController(int index)
		{
			if (this.controller == null)
			{
				this.controller = SteamVR_Controller.Input(index);
				this.HandDebugLog(string.Concat(new object[]
				{
					"Hand ",
					base.name,
					" connected with device index ",
					this.controller.index
				}));
				this.controllerObject = UnityEngine.Object.Instantiate<GameObject>(this.controllerPrefab);
				this.controllerObject.SetActive(true);
				this.controllerObject.name = this.controllerPrefab.name + "_" + base.name;
				this.controllerObject.layer = base.gameObject.layer;
				this.controllerObject.tag = base.gameObject.tag;
				this.AttachObject(this.controllerObject, Hand.AttachmentFlags.SnapOnAttach | Hand.AttachmentFlags.DetachOthers | Hand.AttachmentFlags.DetachFromOtherHand | Hand.AttachmentFlags.ParentToHand, string.Empty);
				this.controller.TriggerHapticPulse(800, EVRButtonId.k_EButton_Axis0);
				this.controllerObject.transform.localScale = this.controllerPrefab.transform.localScale;
				base.BroadcastMessage("OnHandInitialized", index, SendMessageOptions.DontRequireReceiver);
			}
		}

		// Token: 0x04002734 RID: 10036
		public const Hand.AttachmentFlags defaultAttachmentFlags = Hand.AttachmentFlags.SnapOnAttach | Hand.AttachmentFlags.DetachOthers | Hand.AttachmentFlags.DetachFromOtherHand | Hand.AttachmentFlags.ParentToHand;

		// Token: 0x04002735 RID: 10037
		public Hand otherHand;

		// Token: 0x04002736 RID: 10038
		public Hand.HandType startingHandType;

		// Token: 0x04002737 RID: 10039
		public Transform hoverSphereTransform;

		// Token: 0x04002738 RID: 10040
		public float hoverSphereRadius = 0.05f;

		// Token: 0x04002739 RID: 10041
		public LayerMask hoverLayerMask = -1;

		// Token: 0x0400273A RID: 10042
		public float hoverUpdateInterval = 0.1f;

		// Token: 0x0400273B RID: 10043
		public Camera noSteamVRFallbackCamera;

		// Token: 0x0400273C RID: 10044
		public float noSteamVRFallbackMaxDistanceNoItem = 10f;

		// Token: 0x0400273D RID: 10045
		public float noSteamVRFallbackMaxDistanceWithItem = 0.5f;

		// Token: 0x0400273E RID: 10046
		private float noSteamVRFallbackInteractorDistance = -1f;

		// Token: 0x0400273F RID: 10047
		public SteamVR_Controller.Device controller;

		// Token: 0x04002740 RID: 10048
		public GameObject controllerPrefab;

		// Token: 0x04002741 RID: 10049
		private GameObject controllerObject;

		// Token: 0x04002742 RID: 10050
		public bool showDebugText;

		// Token: 0x04002743 RID: 10051
		public bool spewDebugText;

		// Token: 0x04002744 RID: 10052
		private List<Hand.AttachedObject> attachedObjects = new List<Hand.AttachedObject>();

		// Token: 0x04002746 RID: 10054
		private Interactable _hoveringInteractable;

		// Token: 0x04002747 RID: 10055
		private TextMesh debugText;

		// Token: 0x04002748 RID: 10056
		private int prevOverlappingColliders;

		// Token: 0x04002749 RID: 10057
		private const int ColliderArraySize = 16;

		// Token: 0x0400274A RID: 10058
		private Collider[] overlappingColliders;

		// Token: 0x0400274B RID: 10059
		private Player playerInstance;

		// Token: 0x0400274C RID: 10060
		private GameObject applicationLostFocusObject;

		// Token: 0x0400274D RID: 10061
		private SteamVR_Events.Action inputFocusAction;

		// Token: 0x02000609 RID: 1545
		public enum HandType
		{
			// Token: 0x04002750 RID: 10064
			Left,
			// Token: 0x04002751 RID: 10065
			Right,
			// Token: 0x04002752 RID: 10066
			Any
		}

		// Token: 0x0200060A RID: 1546
		[Flags]
		public enum AttachmentFlags
		{
			// Token: 0x04002754 RID: 10068
			SnapOnAttach = 1,
			// Token: 0x04002755 RID: 10069
			DetachOthers = 2,
			// Token: 0x04002756 RID: 10070
			DetachFromOtherHand = 4,
			// Token: 0x04002757 RID: 10071
			ParentToHand = 8
		}

		// Token: 0x0200060B RID: 1547
		public struct AttachedObject
		{
			// Token: 0x04002758 RID: 10072
			public GameObject attachedObject;

			// Token: 0x04002759 RID: 10073
			public GameObject originalParent;

			// Token: 0x0400275A RID: 10074
			public bool isParentedToHand;
		}
	}
}
